package com.itheima.service.impl;

import com.itheima.common.result.JsonResult;
import com.itheima.entity.Dish;
import com.itheima.mapper.DishMapper;
import com.itheima.service.DishService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Arrays;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhengbinghua
 * @since 2023-03-02
 */
@Service
public class DishServiceImpl extends ServiceImpl<DishMapper, Dish> implements DishService {
   @Autowired
   private DishMapper dishMapper;

    @Override
    public JsonResult changeDishStatus(Integer status, String ids) {
        //分割字符串
        String[] split = ids.split(",");
        dishMapper.changeDishStatus(status, Arrays.toString(split));
        return JsonResult.success("修改状态成功！");
    }
}

